﻿@model RiderShop.Mobile.Modle.MyAccount.MyCommentModel
@using Kevin.Shop.Business.Service.Entity.Helper

@foreach (var item in Model.CommentList)
{
    <div class="ItemTable ItemFavorite">
        <div class="ItemLeft">
            <a href="~/Product/ProductDetail?prd=@item.ProductId">
                <img src="@RiderShop.Mobile.Common.Component.SiteUrl.FormatProductImageUrl(Kevin.Shop.Business.Service.Entity.Products.Enumerations.ImageType.Size125, item.ProductId, item.ImageName)">
            </a>
        </div>
        <div class="ItemRight ItemRightWrod">
            <p class="title">商品名称：<a href="~/Product/ProductDetail?prd=@item.ProductId">@item.ProductName</a></p>
            <p class="gray">商品编号：@item.ProductId</p>
            <p class="gray">订单编号：@item.OrderNumber</p>
            <p class="gray">购买日期：@item.InDate</p>
            <p class="gray">购买价格：@item.UnitPrice</p>
        </div>
        <div class="linkToComment">
            @if (string.IsNullOrEmpty(item.PresentPointDisplay))
            {
                <a pid="=@item.ProductId" href="~/MyAccount/PublishComment?prd=@item.ProductId&orderNumber=@item.OrderNumber" class="btn btn-warning">评价</a>
            }
            else
            {
                <a pid="@item.ProductId" class="btn btn-success" data-toggle="modal" data-target="@Html.Raw("#p" + @item.OrderNumber+'_' + @item.ProductId)">查看评价</a>
                <div class="modal fade bs-example-modal-lg" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true" id="@Html.Raw("p" + @item.OrderNumber+'_' + @item.ProductId)">
                    <div class="modal-dialog modal-lg">
                        <div class="modal-content">
                            <div class="modal-header">
                                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                                <h4 class="modal-title" id="myLargeModalLabel">评价信息</h4>
                            </div>
                            <div class="modal-body">
                                <div class="star-line">
                                    <label class="@Html.Raw("re" + @item.Rating)" id="lblRatingLevel">
                                        <ul>
                                            <li></li>
                                            <li></li>
                                            <li></li>
                                            <li></li>
                                            <li></li>
                                        </ul>
                                        <span class="retext">
                                            @if (@item.Rating == 1)
                                            {
                                                @Html.Raw("非常差");
                                            }
                                            else if (@item.Rating == 2)
                                            {
                                                @Html.Raw("比较差");
                                            }
                                            else if (@item.Rating == 3)
                                            {
                                                @Html.Raw("一般");
                                            }
                                            else if (@item.Rating == 4)
                                            {
                                                @Html.Raw("比较好");
                                            }
                                            else if (@item.Rating == 5)
                                            {
                                                @Html.Raw("很好");
                                            }
                                        </span>
                                    </label>
                                </div>
                                <div class="commentview">
                                    标题：@item.Title<br />
                                    @*优点：@item.MeritText<br />
                                    不足：@item.FaultsText<br />*@
                                    描述：@item.Memo
                                </div>
                                @if (!string.IsNullOrWhiteSpace(item.Images))
                                {
                                    var images = item.Images.Split(',');
                                    <div class="clearfix">
                                        <ul id="reviewImageList" class="clearfix">
                                            @foreach (var imageName in images)
                                            {
                                                if (string.IsNullOrWhiteSpace(imageName))
                                                {
                                                    continue;
                                                }
                                                <li>
                                                    <div style="background:url(@(WebClientContext.Current.FileServerDomain+imageName+"?imageView2/0/w/150")) no-repeat center center; background-size:contain;">

                                                    </div>
                                                </li>
                                            }
                                        </ul>
                                    </div>
                                }
                            </div>
                        </div>
                    </div>
                </div>
            }
        </div>
    </div>
}